package models;

import externalBusiness.No2Factory;
import jmeterBusiness.No3Factory;
import org.openqa.selenium.WebDriver;
import testBusiness.No1Factory;

import javax.swing.*;
import java.util.ArrayList;
import java.util.HashMap;

/**
 * Created by yangxianming on 2017/6/16.
 */
public class MyConfig {
    public ArrayList<String> getJavaPidList() {
        return javaPidList;
    }

    public void setJavaPidList(ArrayList<String> javaPidList) {
        this.javaPidList = javaPidList;
    }

    private ArrayList<String> javaPidList;

    private No1Factory no1Factory;

    public No2Factory getNo2Factory() {
        return no2Factory;
    }

    public void setNo2Factory(No2Factory no2Factory) {
        this.no2Factory = no2Factory;
    }


    private No3Factory no3Factory;

    public No3Factory getNo3Factory() {
        return no3Factory;
    }

    public void setNo3Factory(No3Factory no3Factory) {
        this.no3Factory = no3Factory;
    }

    private String appPath;

    public String getAppPath() {
        return appPath;
    }

    public void setAppPath(String appPath) {
        this.appPath = appPath;
    }

    public String getSplitMark(String mark) {
        // mark=startCmd OR splitMark
        return this.splitMark.get(mark);
    }

    public void setSplitMark() {
        this.splitMark.put("startCmd", "cmd /c ");
        this.splitMark.put("splitMark", "\\");
        if (!System.getProperty("os.name").contains("Windows")){
            this.splitMark.put("startCmd", "");
            this.splitMark.put("splitMark", "/");
        }
    }

    public JFrame getjFrame() {
        return jFrame;
    }

    public void setjFrame(JFrame jFrame) {
        this.jFrame = jFrame;
    }

    public String getAirTestLogPath() {
        return airTestLogPath;
    }

    public void setAirTestLogPath(String airTestLogPath) {
        this.airTestLogPath = airTestLogPath;
    }
    private JFrame jFrame;  //用户展示支付宝登陆二维码
    private HashMap<String, String> splitMark = new HashMap<String, String>();   //通过系统名称获取路径的分割符号
    private No2Factory no2Factory;
    private String driverPath;
    private HashMap<String, String> reflectHash = new HashMap<String, String>();
    private String pythonPath; //程序的路径
    private String airTestLogPath; //airTestLog
    private HashMap<String, WebDriver> webDriverHashMap = new HashMap<String, WebDriver>(); //保存多个浏览器驱动
    private ReadProperties propertiesConfig;
    public ReadProperties getPropertiesConfig() {
        return propertiesConfig;
    }
    public void setPropertiesConfig(ReadProperties propertiesConfig) {
        this.propertiesConfig = propertiesConfig;
    }
    public WebDriver getWebDriver(String webDriverKey) {
        return webDriverHashMap.get(webDriverKey);
    }

    public void setWebDriverHashMap(String webDriverKey, WebDriver webDriver) {
        this.webDriverHashMap.put(webDriverKey, webDriver);
    }

    public String getPythonPath() {
        return pythonPath;
    }

    public void setPythonPath(String pythonPath) {
        this.pythonPath = pythonPath;
    }

    public HashMap<String, String> getReflect(){
        return reflectHash;
    }

    public String getReflectValue(String name) {
        return reflectHash.get(name);
    }

    public void setReflectHash(String name, String value) {
        reflectHash.put(name, value);
    }

    public No1Factory getNo1Factory() {
        return no1Factory;
    }

    public void setNo1Factory(No1Factory no1Factory) {
        this.no1Factory = no1Factory;
    }

    public String getDriverPath() {
        return driverPath;
    }

    public void setDriverPath(String driverPath) {
        this.driverPath = driverPath;
    }
}
